package com.ganzalang.gmall.promotion.service.rule.qualify.factory;

import com.ganzalang.gmall.promotion.enums.QualifyEnum;
import com.ganzalang.gmall.promotion.service.rule.qualify.QualifyStrategy;
import com.ganzalang.gmall.promotion.service.rule.qualify.impl.FirstQualifyStrategy;

/**
 * @author Ganzalang
 * @description
 * @Date 2022/4/5 11:07
 */
public class QualifyFactory {

    public static QualifyStrategy getBean(Integer type) {
        QualifyEnum qualifyEnum = QualifyEnum.valueOf(type);
        switch (qualifyEnum) {
            case FIRST_ORDER:
                return new FirstQualifyStrategy();
            default:
                return null;
        }
    }
}
